package day4;

public class Person {

    private String name;
    private int age;

    public void setName(String name){

        if(name.length()>6 || name.length()<2){
            System.out.println("设置的人名不符合要求");
            return;
        }else{
            this.name = name;
        }

    }

    public String getName(){
        return this.name;
    }

    public void setAge(int age){
        if(age>100 || age<0){
            System.out.println("您的年龄不合法");
            return;
        }
    }

    public int getAge(){
        return this.age;
    }



    public void run(){

        Person p = new Person();
        p.setAge(10000);

    }


}
